package com.score.system.service;

import com.score.system.dao.UserMapper;
import com.score.system.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    /**
     * 根据id返回user对象
     * @param id
     * @return
     */
    public User findUserById(int id) {
        return userMapper.selectById(id);
    }

    public User findUserByName(String username) {
        return userMapper.selectByName(username);
    }

    public List<User> findUserByGrade(String username) {
        return userMapper.selectByGrade(username);
    }

}
